Skip to content

Revalidate the pages tag on publish (refresh query-index)#32

Closed
lamontacrook wants to merge 1 commit into
mainfrom
revalidate-pages-tag
Closed

Revalidate the pages tag on publish (refresh query-index)#32
lamontacrook wants to merge 1 commit into
mainfrom
revalidate-pages-tag

Conversation

@lamontacrook

Copy link
Copy Markdown
Contributor

What

/api/revalidate now calls revalidateTag('pages') in addition to revalidateTag('page:<slug>').

Why

The query-index feed is cached under the pages tag (lib/eds/queryIndex.js) and drives:

Publishing a page only cleared that page's own page:<slug> tag, never pages — so newly published/renamed pages didn't appear in the nav/SSG/metadata until the feed's 1-hour cache expired. This surfaced as a mega-menu row showing only the link label (no image/description) for a freshly published page.

Clearing pages on every publish keeps query-index-derived features current immediately.

Verified

npm run lint clean; npm run build succeeds (/api/revalidate compiles).

🤖 Generated with Claude Code

/api/revalidate now clears the `pages` tag in addition to page:<slug>. The
query-index feed (cached under `pages`) drives navigation, generateStaticParams,
and page metadata; publishing a new or renamed page previously didn't refresh it,
so the nav mega-menu and SSG params lagged until the feed's time-based cache
expired. Clearing `pages` on every publish keeps them current.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@aem-code-sync

aem-code-sync Bot commented Jul 6, 2026

Copy link
Copy Markdown

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run all PSI checks
  • Re-run failed PSI checks
  • Re-sync branch
Commits

@lamontacrook

Copy link
Copy Markdown
Contributor Author

Not the right approach — dropping the revalidate/pages-tag machinery in favor of fetching the full query-index fresh (no stale cache). See replacement PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant